_welcomestring = "CUCDSearch" || NL || NL || "Search *only* the CUCDs you want to!" || NL || NL || "Written by Dave Stroud - July 1998"
_nohitsstring="Sorry! No match found!"
_selectstring = "Please choose which CUCD index file(s) to search..."
_OutFile = "RAM:CUCD_SearchResults."
_hits = 0
if rtezrequest(_welcomestring, "Go on then|Oops, I clicked the wrong icon", "CUCDSearch!", _def1) = 0 then do
exit(0)
end
else do
if length(rtfilerequest(_CUCDIndices,,"Select CUCD index file(s) to search:",,_def2,_files)) = 0 then do
exit(0)
end
else do
if _files.count = 0 then do
exit(0)
end
else do
_searchstring=rtgetstring(,"About to start searching "||_files.count||" CUCD index file(s)."||NL||"Please enter a search keyword:","Ready, Steady, Cook!","_Start Search|_Abort","rtgs_flags=gsreqf_centertext",_result)
if _result = 0 then do
rtezrequest("How dare you lead me on like that!", "Bite me", "Aiee!", _def1)
exit(0)
end
if length(_searchstring) < 2 then do
exit(0)
end
else do
_n=1
call time(r)
do until _n>_files.count
address command
_FFpath||' FROM "'||_files._n||'" SEARCH "'||_searchstring||'" QUIET CASESENSITIVE NOPREFS >'||_Outfile||_n
_n=_n+1
call close(_OutFile)
end
_n=1
if ~open(_OUTPUT,_SearchOut,'W') then do
say "ERROR: Couldn't open output file for assembling results"
exit(0)
end
else do
do until (_n > _files.count)
_SearchIn=_OutFile||_n
if ~open(_INPUT,_SearchIn,'R') then do
say "ERROR: Couldn't open individual results output file"